package com.gsi.webstore.platform.storefront.capi.order;

import com.gsi.webstore.platform.storefront.internal.order.GSIOrderBOImpl;
import com.intershop.sellside.appbase.b2c.capi.order.B2COrderBO;
import com.intershop.sellside.appbase.b2c.capi.order.B2COrderBOContext;
import com.intershop.sellside.appbase.b2c.capi.order.B2COrderBOProxyFactory;

public class GSIOrderBOProxyFactory extends B2COrderBOProxyFactory
{
    
    
    public <T extends com.intershop.beehive.core.capi.businessobject.BusinessObject, X extends com.intershop.beehive.core.capi.businessobject.BusinessObjectContext> T createBusinessObject(T businessObject, X context) {

        if (businessObject instanceof B2COrderBO)
        {
            B2COrderBO order = (B2COrderBO)businessObject;
            B2COrderBOContext orderContext = (B2COrderBOContext)context;
            return (T)new GSIOrderBOImpl(order, orderContext, order.getCalculationResultView());            
        }
        return super.createBusinessObject(businessObject, context);
    };
    
}